#ifndef HARDWAREINTERFACEVIEW_HPP
#define HARDWAREINTERFACEVIEW_HPP

#include <QDockWidget>
#include <QStringList>
#include <QDebug>
#include <QMessageBox>
#include <QTime>

#include "qserialdevicewatcher/serialdevicewatcher.h"

namespace Ui {
    class HardwareInterfaceView;
}

class HardwareInterfaceView : public QDockWidget {
    Q_OBJECT
public:
    HardwareInterfaceView(QWidget *parent = 0);
    ~HardwareInterfaceView();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::HardwareInterfaceView *ui;
    SerialDeviceWatcher *serialWatcher;

private slots:
    void onSerialDevicesChanged(QStringList devices);
    void on_cb_Activated_clicked();
    void on_db_ComPort_currentIndexChanged(int index);
    void on_btn_ManualReceive_clicked();

public slots:
    void onHardwareInterfaceStateChanged();
    void onError(QString device, QString errorString);
    void onDataRead(QString data);
    void onDataWritten(QString data);

signals:
    void changeHardwareInterfaceState(QString name, bool state);
    void manualSend();
    void manualReceive(QString data);
};

#endif // HARDWAREINTERFACEVIEW_HPP
